﻿/*                  Error Handling Functions                 */

#region NameSpace
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Text;
#endregion

namespace ebird.ErrorHandlerHelper
{
   public class ErrorLog
   {
       #region Fields
       private string sLogFormat;
	   private string sErrorTime;
       #endregion

       #region Constructor
       public ErrorLog()
		{
			//sLogFormat = DateTime.Now.ToShortDateString().ToString()+" "+DateTime.Now.ToLongTimeString().ToString()+" ==> ";
        }
       #endregion

       #region Methods
       /// <summary>
       /// Write Error Message in  a TextFile
       /// </summary>
       /// <param name="sPathName"></param>
       /// <param name="sErrMsg"></param>
       public static void LogWriter(string sPathName, string sErrMsg)
		{
            string sLogFormat;
	        string sErrorTime;
            sLogFormat = DateTime.Now.ToShortDateString().ToString() + " " + DateTime.Now.ToLongTimeString().ToString() + " ==> ";
			StreamWriter sw = new StreamWriter(sPathName,true);
			sw.WriteLine(sLogFormat + sErrMsg);
			sw.Flush();
			sw.Close();
        }
       #endregion
   }
}
